package com.prs.crm.domain.online;

import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;

/**
 * 
 * @author Yanghao
 * @version 2012-7-19 10:24:06 投票
 */
@Entity
@Table(name="on_vote")
public class Vote extends BaseEntity{

	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Integer id;
	/**标题*/
	private String title;
	/**内容*/
	private String content;
	/**最后投票人*/
	private String lastPerson;
	/**最后投票时间*/
	private String lastTime;
	/**投票数*/
	private Integer voteNum;
	/**人气*/
	private Integer readyNum;
	/**时限*/
	private Date limitDate;
	/**是否匿名*/
	private String isAnonymity;
	/**选项*/
	private String options;
	/**当前时间*/
	private String date;
	private String showVote;
	private String shouSubmit;
	private Integer anonymityId;//匿名

	public Integer getAnonymityId() {
		return anonymityId;
	}
	public void setAnonymityId(Integer anonymityId) {
		this.anonymityId = anonymityId;
	}
	public String getShouSubmit() {
		return shouSubmit;
	}
	public void setShouSubmit(String shouSubmit) {
		this.shouSubmit = shouSubmit;
	}
	public String getShowVote() {
		return showVote;
	}
	public void setShowVote(String showVote) {
		this.showVote = showVote;
	}
	private String votePerson;
	@OneToMany(fetch=FetchType.LAZY,mappedBy="vote")
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private List<VoteItem> voteItem;
	public List<VoteItem> getVoteItem() {
		return voteItem;
	}
	public void setVoteItem(List<VoteItem> voteItem) {
		this.voteItem = voteItem;
	}
	public String getVotePerson() {
		return votePerson;
	}
	public void setVotePerson(String votePerson) {
		this.votePerson = votePerson;
	}
	private Integer state;
	
	private String remark;
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Integer getState() {
		return state;
	}
	public void setState(Integer state) {
		this.state = state;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach;
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getLastPerson() {
		return lastPerson;
	}
	public void setLastPerson(String lastPerson) {
		this.lastPerson = lastPerson;
	}
	public String getLastTime() {
		return lastTime;
	}
	public void setLastTime(String lastTime) {
		this.lastTime = lastTime;
	}
	public Integer getVoteNum() {
		return voteNum;
	}
	public void setVoteNum(Integer voteNum) {
		this.voteNum = voteNum;
	}
	public Integer getReadyNum() {
		return readyNum;
	}
	public void setReadyNum(Integer readyNum) {
		this.readyNum = readyNum;
	}
	public Date getLimitDate() {
		return limitDate;
	}
	public void setLimitDate(Date limitDate) {
		this.limitDate = limitDate;
	}
	public String getIsAnonymity() {
		return isAnonymity;
	}
	public void setIsAnonymity(String isAnonymity) {
		this.isAnonymity = isAnonymity;
	}
	public String getOptions() {
		return options;
	}
	public void setOptions(String options) {
		this.options = options;
	}
	public String getDate() {
		return date;
	}
	public void setDate(String date) {
		this.date = date;
	}
}
